<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>

<body>
    <!-- https://locally.uieee.com/slides -->

    <script>
        /*
        $(function () {
    
            $.ajax({
                url: "https://locally.uieee.com/slides",
                data: {},
                success: function (res) {
                    console.log(res)
                    $.ajax({
                        url: 'https://locally.uieee.com/categories',
                        success: function (res) {
                            console.log(res)
                            $.ajax({
                                url: 'https://locally.uieee.com/categories/2/shops',
                                success: function (res) {
                                    console.log(res)
                                    $.ajax({
                                        url: "https://locally.uieee.com/slides",
                                        data: {},
                                        success: function (res) {
                                            console.log(res)
                                            $.ajax({
                                                url: 'https://locally.uieee.com/categories',
                                                success: function (res) {
                                                    console.log(res)
                                                    $.ajax({
                                                        url: 'https://locally.uieee.com/categories/2/shops',
                                                        success: function (res) {
                                                            console.log(res)
                                                            $.ajax({
                                                                url: "https://locally.uieee.com/slides",
                                                                data: {},
                                                                success: function (res) {
                                                                    console.log(res)
                                                                    $.ajax({
                                                                        url: 'https://locally.uieee.com/categories',
                                                                        success: function (res) {
                                                                            console.log(res)
                                                                            $.ajax({
                                                                                url: 'https://locally.uieee.com/categories/2/shops',
                                                                                success: function (res) {
                                                                                    console.log(res)
                                                                                }
                                                                            })
                                                                        }
                                                                    })
                                                                }
                                                            })
                                                        }
                                                    })
                                                }
                                            })
                                        }
                                    })
                                }
                            })
                        }
                    })
                }
            })
          
        })
          */





          $(function() {

        //    $.ajax({url:'https://locally.uieee.com/slides'})
        //     .then(res=>{
        //         console.log(res)
        //        return   $.ajax({url:'https://locally.uieee.com/categories'}) 
        //     })
        //     .then(res=>{
        //         console.log(res)
        //          return $.ajax({url:'https://locally.uieee.com/slides'})
        //     .then(res=>{
        //         console.log(res)
        //        return   $.ajax({url:'https://locally.uieee.com/categories'}) 
        //     })
        //     .then(res=>{
        //         console.log(res)
        //     })

        //     })


            function  getData(url='',params={}) {
                return $.ajax({url,data:params})
            }

           getData('https://locally.uieee.com/slides')
            .then(res=>{
                console.log(res)
                return  getData('https://locally.uieee.com/categories')
            })
            .then(res=>{
                console.log(res)
            })
            .catch(err=>{
                console.log(err)
            })
           




          })
    </script>


</body>

</html>